#include "qbreakout.h"

void QBreakOut::initializeGL(){
    QExpandOpenGLWidget::ResourceManager::parent = this;
    this->resize(1000,800);
    this->initializeOpenGLFunctions();

    Breakout = std::make_shared<Game>(this->width(),this->height(), this);
    // Start Game within Menu State
    Breakout->State = GAME_ACTIVE;
    // Initialize game
    Breakout->Init();
}

void QBreakOut::resizeGL(int w, int h){
    QExpandOpenGLWidget::resizeGL(w, h);
}


void QBreakOut::paintGL(){
    // Render
    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);
    Breakout->Render();
    this->update();
}
